<template>
  <div>
    <div v-for="item in tableData" class="u-flex u-row-between">
      <span>{{ item.statroomnumber }}{{ item.statroomname }}</span>
      <span @click="handleView(item)">查看</span>
      <span @click="handleCheck(item)">核对</span>
    </div>

    <button style="margin-top:30px;" @click="jump">
      点击进入操作项模拟页面
    </button>
  </div>
</template>

<script>
import { findSubstationList } from "@/request/api.js";
export default {
  name: "electDrawList",
  data() {
    return {
      tableData: [],
    };
  },
  mounted() {
    this.initData()
  },
  methods: {
    jump() {
      this.$router.push("/electDraw");
    },
    // 初始化数据
    async initData() {
      let res = await findSubstationList();
      if (res && res.length > 0) {
        this.tableData = res;
      }
    },
    // 站点表格列表
    async findSubstationList(data) {
      let res = await findSubstationList(data);
      if (res && res.length > 0) {
        this.tableData = res;
      }
      else {
        this.tableData = [];
        this.$message("查无数据")
      }
    },
    handleView(item) {
      let { statroomname, statroomnumber } = item;
      this.$router.push({
        path: "/electDrawView",
        query: { statroomname, statroomnumber },
      });
    },
    handleCheck(item) {
      let { statroomname, statroomnumber } = item;

      this.$router.push({
        path: "/electDrawCheck",
        query: { statroomname, statroomnumber },
      });
    },
  },
};
</script>
<style></style>
